package com.hanson.config;

import com.hanson.utils.ThreadPoolUtil;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;

/**
 * @description: 应用关闭时执行，这里是关闭设置
 * @classname: ShutDownHookConfig
 * @author: HansonLee
 * @create: 2024/03/26
 **/
@Component
public class ShutDownHookConfig {

    @PreDestroy
    public void onShutdown() {
        //关闭自定义线程池
        ThreadPoolUtil.shutdown();
    }
}
